<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class news extends Model{

    // 指定表名
	protected $table = 'news';

    protected $fillable = ['title', 'author', 'content'];
	// 指定主键
    protected $primaryKey = 'id';

    
    protected $dateFormat = 'U';
    // 自定义时间戳
    public $timestamps = true;

    

    public function getDateFormat(){
        return time();
    }

    protected function asDateTime($val){
        return $val;
    }


    

}